<template>
	<div>
		<!--表格操作项目-->
		<table class="table" cellspacing="0" cellpadding="0">
			<tbody>
				<tr>
					<th>id</th>
					<th>用户昵称</th>
					<th>登录方式</th>
					<th>登录平台</th>
					<th>登录IP</th>
					<th>登录时间</th>
				</tr>
			</tbody>
			<tbody>
				<tr v-for="(item,index) in list" :key="index">
					<td>{{item.id}}</td>
					<td>{{item.nickname}}</td>
					<td>{{item.mode}}</td>
					<td>{{item.platform}}</td>
					<td>{{item.ip}}</td>
					<td>{{item.create_time}}</td>
				</tr>
			</tbody>
		</table>
		<!-- 分页 -->
		<div class="padding-t-20">
			<a-pagination :pageSize="pageSize" :current="page" :total="count"
				@change="clickPage" :pageSizeOptions="pageSizeOptions" show-size-changer
				@showSizeChange="onShowSizeChange" show-quick-jumper />
		</div>
	</div>
</template>

<script>
	import apiUser from '../../api/user.js'
	
	export default {
	    data() {
	    	return {
				pageSizeOptions: ['20', '50', '100', '150'],
				count: '',
				page: 1,
				pageSize: 20,
				
				list:''
	        }
	    },
		mounted() {
			this.getList()
		},
		methods:{
			getList(){				
				apiUser.getUserLoginLog(this.page, this.pageSize).then(res => {
					this.list = res.result.data;
					this.page = res.result.page
					this.pageSize = res.result.pageSize
					this.count = res.result.count
				})
			},
			clickPage(e) {
				this.page = e
				this.getList()
			},
			onShowSizeChange(current, pageSize) {
				this.pageSize = pageSize
				this.page = 1
			}
		}
	}
</script>

<style>
</style>